﻿CREATE PROCEDURE [acms].[Post_GetAllByPostGuid]
	@PostGuid uniqueidentifier
AS
	SELECT a.*, b.[ParentPath] as ParentPath, b.PublishDate as SiteVersion
	From Post_View a inner join PostPositions b on a.Id = b.PostId and isNull(a.PublishFrom, '9999/12/31') = isNull(b.PublishDate, '9999/12/31')
	Where a.PostGuid = @PostGuid
	Order By isNull(a.PublishFrom, '9999/12/31') desc
RETURN 0